import 'dart:io';
import 'dart:math';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:wu_you/plugins/advertising_plugin.dart';
import 'package:wu_you/widgets/kb_progress_indicator.dart';

///激励视频页面
class RewardVideoPage extends StatefulWidget {
  final String type;
  final String sn;
  final String number;
  RewardVideoPage({Key key,this.type,this.sn,this.number}): super(key: key);
  @override
  _RewardVideoPageState createState() => _RewardVideoPageState();
}

class _RewardVideoPageState extends State<RewardVideoPage> {
  String prompt;
  @override
  void initState() {
    super.initState();
    AdPlugin().showAd(type: widget.type,sn: widget.sn,number: widget.number);
  }
  @override
  Widget build(BuildContext context) {
    return WillPopScope(
      child: Scaffold(
        backgroundColor: Colors.black,
        body: Center(
          child: KbProgressIndicator(),
        ),
      ),
      onWillPop:() async{
        Navigator.of(context).pop("noAdResult");
        return true;
      }
    );
  }
}
